
<html>
<body>

<?php
$UserName = $_POST['username'];
$FName = $_POST['fName'];
$MInitial = $_POST['mInitial'];
$LName = $_POST['lName'];
$Address = $_POST['address'];
$City = $_POST['city'];
$State = $_POST['state'];
$Zip = $_POST['zip'];
$Country = $_POST['country'];
$Phone1 = $_POST['phone1'];
$Phone2 = $_POST['phone2'];
$Phone3 = $_POST['phone3'];
$EMail = $_POST['eMail'];
$Password = $_POST['password1'];
$RePass = $_POST['passwordReType'];
$AccountType = $_POST['acctType'];
$Descript = $_POST['Descript'];
$URL = $_POST['URL'];
$Company = $_POST['cName'];

$PhoneNumber = $Phone1.$Phone2.$Phone3;

$FullAddress = explode(' ', $Address);
$StreetNum = $FullAddress[0];
$Road = $FullAddress[1];


include 'DatabaseConnect.inc';

$query = "INSERT INTO User (LoginID, Password, Email, PhoneNumber, State, City, Street_Num, Road, Zip_Code, Country, Type ) Values ('$UserName', '$Password', '$EMail', '$PhoneNumber', '$State', '$City', '$StreetNum', '$Road', '$Zip', '$Country', '$AccountType')";

mysql_query($query);

if($AccountType == 'D')
{
	$query1 = "INSERT INTO Dealer (CompanyName, Description, URL, LoginID) Values ('$Company', '$Descript', '$URL', '$UserName')";
}
if($AccountType == 'R')
{
	$query1 = "INSERT INTO RegisteredUser (LoginID, FName, MInitial, LName) Values ('$UserName', '$FName', '$MInitial', '$LName')";
}

mysql_query($query1);


mysql_close();


?>

<h1>Account Has Been Added!</h1>
<br />
<br />
<a href="index.php">Return To Index</a>


</body>
</html>

